import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class AppHeader extends StatelessWidget {
  final Widget leading;
  final String title;
  final List<Widget> actions;
  AppHeader({this.leading, this.title, this.actions});

  @override
  Widget build(BuildContext context) {
    double screenTop = MediaQuery.of(context).padding.top;
    return SizedBox(
      height: ScreenUtil.getInstance().setWidth(220),
      child: Container(
        color: Theme.of(context).primaryColor,
        padding: EdgeInsets.only(right: 10),
        child: Column(
          mainAxisAlignment: MainAxisAlignment.start,
          children: <Widget>[
            SizedBox(
              height: screenTop,
            ),
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: <Widget>[
                Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: <Widget>[
                    Container(
                      alignment: Alignment.centerLeft,
                      child: leading ?? Text('   '),
                    ),
                    Text(
                      title ?? 'hello',
                      style: TextStyle(color: Colors.black,),
                    )
                  ],
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.end,
                  children: <Widget>[
                    IconButton(
                      alignment: Alignment.centerRight,
                      icon: Icon(Icons.search),
                      highlightColor: Colors.transparent,
                      iconSize: 12,
                      onPressed: (){},
                    ),
                    IconButton(
                      alignment: Alignment.centerRight,
                      icon: Icon(Icons.add_circle_outline),
                      highlightColor: Colors.transparent,
                      iconSize: 12,
                      onPressed: (){},
                    ),
                  ],
                )
              ],
            ),
          ],
        ),
      ),
    );
  }
}
